<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>GAP</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <script src="https://cdn.bootcss.com/jquery/3.3.0/jquery.min.js" type="text/javascript"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" type="text/javascript"></script>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet" />
</head>
<style type="text/css">
    html,
    body {
        width: 100%;
        min-height: 100%;
        padding: 0;
        margin: 0;
    }

    body {
        background-image: url(image/bg.png);
        background-size: 100% 100%;
        background-position: top;
        background-repeat: no-repeat;
        min-height: 100%;
    }

    .logo {
        width: 100%;
        margin-top: 20px;
    }

    #registerFormData {}

    #registerFormData button {
        border: 0;
        font-size: 14px;
        color: #FFF;
        padding: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
    }

    .verify_btn {
        width: 32%;
        display: inline-block;
        padding: 0 0 !important;
        height: 34px;
        color: #00A0E9 !important;
        background: none;
    }

    .verify_btn[disabled] {
        background-color: #e5e5e5;
    }

    form {
        margin-top: 50px;
        background-image: url(image/form_bg.png);
        background-size: 100% 100%;
        background-repeat: no-repeat;
        padding: 10px;
        padding-bottom: 3rem;
    }

    .form-group {
        width: 80%;
        margin-left: 10%;
    }


    h4 {
        border-bottom: 1px dashed #FFF;
        color: #FFF;
        text-align: center;
        padding-bottom: 10px;
    }

    .introduce {
        text-align: center;
        display: flex;
        justify-content: space-between;
    }

    .introduce div {
        width: 30%;
        margin-left: 2%;
        height: 70px;
        font-size: 12px;
        color: white;
        padding-top: 15px;

    }



    .register-tip {
        margin-top: 3%;
        font-size: 1.6rem;
        text-align: center;
        margin-bottom: 10px;
    }

    .btn-primary {
        width: 100%;
        background: url("image/submit_btn.png")no-repeat;
        -webkit-background-size: 100% 100%;
    }

    .introduce-two {
        width: 100%;
        margin-left: 2%;
        margin-top: 5%;
        text-align: center;
    }

    .introduce-two div {
        width: 33%;
        font-size: 1.3rem;
        color: black;
    }

    .introduce-two img {
        width: 80px;
        height: 74px;
    }

    .introduce-two p {
        margin-top: 10px;
        font-size: 12px;
    }


    .introduce-three {
        width: 96%;
        margin-left: 2%;
        margin-top: 5%;
        text-align: center;
    }

    .introduce-three div {
        font-size: 1.3rem;
        color: black;
    }


    .introduce-three img {
        width: 80px;
        height: 74px;
    }

    .introduce-three p {
        margin-top: 10px;
    }

    .bottom-tips {
        margin-top: 2rem;
        color: white;
        text-align: center;
        padding-bottom: 2rem;
        font-size: 12px;
    }

    #img_input {
        opacity: 0;
        background-image: url("../img/tx@2x.png")no-repeat;
        background-color: #000;
        width: 84px;
        height: 84px;
        position: absolute;
        top: 5rem;
        left: 8.5rem;
    }

    .preview {
        width: 100%;
    }

    .bg_yy {
        color: #00FFF6;
        background: #5e6496;
        height: 30px;
        line-height: 30px;
        border-radius: 4px;
        margin-top: 1rem;
    }

    .yq {
        text-align: center;
    }

    .yq>img {
        width: 100%;
    }

    .down {
        background: url("image/bg_hui.png")no-repeat;
        padding: .5rem 0px;
        display: flex;

    }

    .logo_a>img {
        width: 47px;
        height: 49px;
    }

    p {
        margin: 0px !important;
    }

    .p2 {
        color: #b4b4b4;
        font-size: 12px;
        text-overflow: ellipsis;
        overflow: hidden;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .xz_but {
        background: url("image/submit_btn.png")no-repeat;
        width: 70px;
        height: 25px;
        background-size: 100% 100%;
        margin: 18px 0px 0px -15px;
        text-align: center;
        line-height: 25px;
    }

    .mid {
        margin-top: 0.5rem;
    }

    .box {
        width: 95%;
        display: flex;
        justify-content: space-between;
        margin-left: 7px;
    }

    .spe {
        width: 32%;
        font-size: 12px;
        color: #fff;
        height: 6rem;
    }

    .spe>div {
        text-align: center;
        /* padding: 0px 6px; */
    }

    .spe>div:nth-child(1) {
        margin-top: .5rem;
    }

    .form-control {
        color: #a09d9d;
    }

    .row {
        margin-right: 0px !important;
        margin-left: 0px !important;
    }

    .col-xs-3 {
        width: 33.33% !important;
    }

    .col-xs-3 {
        padding-right: 0px !important;
        padding-left: 0px !important;
    }

    .col-xs-7 {
        width: auto !important;
    }

    .yy_qh {
        color: #fff;
        float: right;
        padding: .5rem 0px;
        cursor: pointer;
    }

    a:focus,
    a:hover {
        text-decoration: none !important;
        color: #00FFF6 !important;
    }

    #gotCode {
        background: none !important;
    }

    .from-groups {
        width: 80%;
        margin-left: 10%;
        margin-bottom: 5%;
    }

    .from-groups img {
        width: 62%;
    }
</style>

<body>
    <div class="container-fluid">
        <a href="javascript:load();" class="yy_qh">(Chinese Simplified)</a>
        <marquee class="bg_yy">welcome! Gap global and grow with you on the road to wealth</marquee>
        <a href="#" id="fileSelect">
            <div class="icon_tx preview_box">
                <img style="width:100%;margin-top:3rem;" src="image/logo.png" alt="">
            </div>
        </a>
        <input id="img_input" type="file" accept="image/*" />
        <label for="img_input"></label>
        <div class="yq"><img src="image/yq_zia.png" alt=""></div>
        <form id="registerFormData">
            <!-- <div class="row introduce">
                <div class="col-xs-4" style="background: url(image/nav_bg_1.png);background-size: 100% 100%;
                padding: 17px 2px;">
                    <span>平台型战略</span>
                    <span>(去中心化系统融合)</span>
                </div>
                <div class="col-xs-4" style="background: url(image/nav_bg_2.png);background-size: 100% 100%;padding: 17px 2px;">
                    <span>导入钱包</span>
                    <span>(支持多种数字token)</span>
                </div>
                <div class="col-xs-4" style="background: url(image/nav_bg_3.png);background-size: 100% 100%;padding: 17px 2px;">
                    <span>应用生态DAPP</span>
                    <span>(更强的落地)</span>
                </div>
            </div> -->
            <div class="box">
                <div class="spe"
                    style="background: url(image/nav_bg_1.png);background-size: 100% 100%;margin: 3rem 0px 0px 0px;">
                    <div>Platform strategy</div>
                    <div>(Decentralized system integration)</div>
                </div>
                <div class="spe"
                    style="background: url(image/nav_bg_2.png);background-size: 100% 100%;margin: 3rem 0px 0px 0px;">
                    <div>Import wallet</div>
                    <div>(support multiple digital tokens)</div>
                </div>
                <div class="spe"
                    style="background: url(image/nav_bg_3.png);background-size: 100% 100%;margin: 3rem 0px 0px 0px;">
                    <div>Applied Eco DAPP</div>
                    <div>(stronger landing)</div>
                </div>
            </div>
            <div class="register-tip">Welcome all the "leaders", "teacher" download registration</div>
            <input type="hidden" name="type" value="1">
            <div class="form-group">
                <input type="text" class="form-control" id="nickname" name="user_name" placeholder="username">
            </div>
            <div class="form-group">
                <select class="form-control" name="country" id='area'>
                    <option value="86">China+86</option>
                    <option value="852">Hong Kong+852</option>
                    <option value="852">Taiwan+886</option>
                    <option value="1">United States+1</option>
                    <option value="91">India+91</option>
                    <option value="62">Indonesia+62</option>
                    <option value="65">Singapore+65</option>
                    <option value="84">Vietnam+84</option>
                    <option value="66">Thailand+66</option>
                    <option value="855">Cambodia+855</option>
                    <option value="44">United Kingdom+44</option>
                    <option value="81">Japan+81</option>
                    <option value="82">Korea+82</option>
                    <option value="63">Philippines+63</option>
                    <option value="60">Malaysia+60</option>
                </select>
            </div>
            <div class="form-group">
                <input type="text" class="form-control" name="mobile" id="mobile" placeholder="Bind mobile number">
            </div>
            <div class="from-groups">
                <img src="http://gap.topscope.com.cn/captcha.html" alt="">
                <button type="button" class="verify_btn" id="goStart">Regain</button>
            </div>
            <div class="form-group">
                <input type="type" class="form-control" name="password" id="verify_code"
                    placeholder="Please fill in your Graphics Verification Code">
            </div>
            <div class="form-group">
                <input id="code" type="text" class="form-control" name="verify_code" placeholder="Verification code"
                    style="width: 60%;display: inline-block;">
                <button type="button" class="verify_btn" id="gotCode">Obtain</button>
            </div>
            <div class="form-group">
                <input type="password" class="form-control" name="password" id="password" placeholder="login password">
            </div>
            <div class="form-group">
                <input type="password" class="form-control" name="password" id="confirm_pwd"
                    placeholder="reset Password">
            </div>
            <div class="form-group">
                <input type="type" disabled='true' class="form-control" name="repass" id="invite_code"
                    placeholder="Invitation code">
            </div>
            <div class="form-group">
                <button type="button" id="next" class="btn btn-primary" onclick="register()">
                    Register now and become a big brother
                </button>
            </div>
            <div class="register-tip">Rich and diverse technology presentation</div>
            <div class="row  introduce-two">
                <div class="col-xs-4">
                    <img src="image/nav_bg_4a.png" />
                    <p>Bbs meet international needs</p>
                </div>
                <div class="col-xs-4">
                    <img src="image/nav_bg_5a.png" />
                    <p>Find more companions here.</p>
                </div>
                <div class="col-xs-4">
                    <img src="image/nav_bg_6a.png" />
                    <p>Has a powerful node that is highly distributed</p>
                </div>
            </div>
            <div class="row  introduce-three">
                <!-- <div class="col-xs-2">
                </div> -->
                <div class="col-xs-6">
                    <img src="image/nav_bg_7a.png" />
                    <p>Internationalization of 100 technology alliances</p>
                </div>
                <div class="col-xs-6">
                    <img src="image/nav_bg_8a.png" />
                    <p>More industry first information</p>
                </div>
                <!-- <div class="col-xs-2">
                </div> -->
            </div>
        </form>
        <div class="bottom-tips">
            If you have any questions, please contact our customer service hotline:+60-01156918493
            <p>Working day:9：00 - 22：00 Non-working days:10：00 - 15：00</p>
        </div>
    </div>
    <footer style="color: white;">
        <div class="row down">
            <div class="col-xs-2 logo_a">
                <img src="image/logo_a.png" />
            </div>
            <div class="col-xs-7 mid">
                <p>GAP-ecological creator</p>
                <p class="p2">Can buy coins, can store coins, can play games, can appreciate</p>
            </div>
            <div class="col-xs-3">
                <div id="nexts" class="xz_but">download</div>
            </div>
        </div>
    </footer>
</body>
<script>
    window.onload = function () {
        function getQueryString(name) {

            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");

            var r = window.location.search.substr(1).match(reg);

            if (r != null) return unescape(r[2]);
            return null;

        }
        function load(){
            var ur='reg.html?invite_code=' +getQueryString('invite_code');
            window.location.href=ur;

        }
        $("#invite_code").val(getQueryString('invite_code'))

        // alert(getQueryString('invite_code'))

        var reset_token = '';
        //重新刷新验证码

        $('#goStart').click(function () {
            $('.from-groups img').attr('src', "http://gap.topscope.com.cn/captcha.html?t=" + new Date().getTime())
        })
        //验证码接口
        $('#gotCode').click(function () {
            var time = null;
            this.disabled = true;
            var that = this;
            var count = 120;
            var area = $("#area option:selected").val();
            var mobile = $('#mobile').val();
            var verifiy_code = $('#verify_code').val();
            var aj = $.ajax({
                url: 'http://gap.topscope.com.cn/api.php/common/send_sms',
                data: {
                    lang: 'en-us',
                    access_token: '5b7f60aca7e7f6f8c680b1b219ad3ec6',
                    mobile: mobile,
                    type: 1,
                    area: area,
                    verifiy_code:verifiy_code
                },
                type: 'post',
                cache: false,
                dataType: 'json',
                success: function (data) {

                    that.disabled = false


                    if (data.code == 1) {
                        alert(data['msg']);
                        return false
                    }

                    var timer = setInterval(function () {
                        that.disabled = true
                        count--;
                        that.innerHTML = "left" + count + "second";
                        if (count == 0) {
                            that.disabled = false
                            $("#gotCode").css('background', '#4395FF');
                            clearInterval(timer);
                        }
                    }, 1000);

                    $("#gotCode").css('background', 'rgba(153,154,165,1)');
                    alert(data['msg']);
                    coding = data['dat']

                },
                error: function () {
                    // alert(data['msg']);
                }
            });

        })



        let cover_id = ''
        let coding = ''
        // 上传图片的接口
        function select() {
            var ie = navigator.appName == "Microsoft Internet Explorer" ? true : false;
            if (ie) {
                document.getElementById("file").click();
            } else {
                var a = document.createEvent("MouseEvents");
                a.initEvent("click", true, true);
                document.getElementById("file").dispatchEvent(a);
            }
        }

        function submit() {
            //文件上传
        }
        $("#img_input").on("change", function (e) {
            var file = e.target.files[0]; //获取图片资源
            // 只选择图片文件
            if (!file.type.match('image.*')) {
                return false;
            }
            var reader = new FileReader();
            reader.readAsDataURL(file); // 读取文件
            // 渲染文件
            reader.onload = function (arg) {
                var img = '<img class="preview" src="' + arg.target.result + '" alt="preview"/>';
                $(".preview_box").empty().append(img);
            }

            var form_data = new FormData();
            var file = $("#img_input").prop("files")[0];
            var access_token = '5b7f60aca7e7f6f8c680b1b219ad3ec6'

            // 把上传的数据放入form_data
            form_data.append("file", file);
            form_data.append("access_token", access_token);

            $.ajax({
                lang: 'en-us',
                type: "POST", // 上传文件要用POST
                url: "http://gap.topscope.com.cn/api.php/common/pictureUpload1",
                dataType: "json",
                crossDomain: true, // 如果用到跨域，需要后台开启CORS
                processData: false, // 注意：不要 process data
                contentType: false, // 注意：不设置 contentType
                data: form_data,
                success: function (data) {
                    cover_id = data['data'].id
                },
                error: function () {
                    alert("fail")
                }
            });
        });
        // 注册接口
        $('#next').click(function () {
            // 注册的接口
            var options = $("#gotCode")
            var options = $("#area option:selected")
            var area = options.val();
            var token = coding
            var access_token = '5b7f60aca7e7f6f8c680b1b219ad3ec6'
            var mobile = $("#mobile").val()
            var nickname = $("#nickname").val()
            var code = $("#code").val()
            var invite_code = $("#invite_code").val()
            var password = $("#password").val()
            var confirm_pwd = $("#confirm_pwd").val()


            var aj = $.ajax({
                url: 'http://gap.topscope.com.cn/api.php/common/register',
                data: {
                    lang: 'en-us',
                    access_token: access_token,
                    mobile: mobile,
                    nickname: nickname,
                    area: area,
                    cover_id: cover_id,
                    code: code,
                    token: token,
                    invite_code: invite_code,
                    password: password,
                    confirm_pwd: confirm_pwd
                },
                type: 'post',
                cache: false,
                dataType: 'json',
                success: function (data) {
                    alert(data['msg']);
                },
                error: function () {
                    alert(data['msg']);
                }
            });

        })
        //获取头部url的值
         $("#nexts").click(function () {
          window.location.href ="https://fir.im/bwmh";


       })

        //糖果的接口
        var invite_code = $("#invite_code").val()
        var aj = $.ajax({
            url: 'http://gap.topscope.com.cn/api.php/common/sweep_code',
            data: {
                lang: 'en-us',
                access_token: '5b7f60aca7e7f6f8c680b1b219ad3ec6',
                invite_code: invite_code
            },
            type: 'post',
            cache: false,
            dataType: 'json',
            success: function (data) {


                // alert("修改成功！");
            },
            error: function () {
                alert("Candy interface is abnormal!");
            }
        });
    }
</script>

</html>